package com.yx.changdao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yx.changdao.common.entity.Department;
import com.yx.changdao.common.mapper.DepartmentMapper;
import com.yx.changdao.service.DepartmentService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: <br/>
 * 部门表
 * <p>
 * <br/>
 * @Auther: flexible
 * @create 2020/04/02 13:47
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {

    @Override
    public List<Department> departments() {
       return baseMapper.selectList(new QueryWrapper<Department>()
                .select(Department.DEP_ID,Department.DEP_NAME));
    }

    @Override
    public Department getByDptName(String name) {
        return baseMapper.selectOne(new QueryWrapper<Department>()
                .eq(Department.DEP_NAME,name));
    }
}
